#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QListWidget>
#include <QMainWindow>
#include <QSystemTrayIcon>
#include "libmodbus/modbus.h"

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private slots:
    void on_pushButton_clicked();

    void on_pushButton_2_clicked();

    void on_pb_dataclear_clicked();

    void on_IconActivated(QSystemTrayIcon::ActivationReason reason);

    void on_pb_InputDel_clicked();

    void on_pb_InputAdd_clicked();

    void on_pb_serialadd_clicked();

    void on_pb_serialdel_clicked();

    void on_pb_serialconfirm_clicked();

    void on_pb_InputConfirm_clicked();

    void on_pb_OuputConfirm_clicked();

    void on_pb_OutputAdd_clicked();

    void on_pb_OutputDel_clicked();

    void on_pb_start_clicked();

    void on_pb_stop_clicked();

    void stateInputToggle(QListWidgetItem *listIcon);

    void stateOutputToggle(QListWidgetItem *listIcon);

    void changeIcon(QListWidgetItem *listicon,QIcon icon);
private:
    Ui::MainWindow *ui;
    UINT16 maindatabase[512];
    void appStart();
    void appStop();
    QIcon up_c;
    QIcon up_b;
    QIcon down_c;
    QIcon down_b;
};

#endif // MAINWINDOW_H
